from django import forms
from django.contrib import admin
from django.contrib.admin import widgets
from django.contrib.auth.models import User,Group
from trees.models import Plant, Species, Rx

class PlantAdmin(admin.ModelAdmin):
    # exclude = ('groups',) 
    # search_fields = ['user__last_name','user__first_name']
    raw_id_fields = ('specie', )
    list_display = ('address','address_order','species_o')
    search_fields = ['address','specie__latin_name','specie__common_name']    


class SpeciesAdmin(admin.ModelAdmin):
    # exclude = ('groups',) 
    search_fields = ['latin_name','common_name']
    list_display = ('latin_name','common_name',)    


class RxAdmin(admin.ModelAdmin):
    # exclude = ('groups',) 
    # search_fields = ['user__last_name','user__first_name']
    raw_id_fields = ('plant', )
    
admin.site.register(Plant, PlantAdmin)
admin.site.register(Species, SpeciesAdmin)
admin.site.register(Rx,RxAdmin)
